package com.totoro.mapper;

import com.totoro.pojo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author TOTORO
 * @date 2021/7/19 11:39
 */
@Repository
public interface SellerMapper {

    User findUserBySlid(@Param("slid") int slid);

    User findUserByUid(@Param("uid") int uid);

    Seller findSellerIdByUserId(@Param("uid") int uid);

    Seller findSellerBySlid(@Param("slid") int slid);

    Integer updateSellerScore(@Param("score") int score, @Param("slid") int slid);

    List<Product> directFindSellerBuyBaby(@Param("slid") int slid);

    List<Product> termFindSellerBuyBaby(BuyProductTerm buyProductTerm);

    List<Product> termFindSellerDeleteBaby(BuyProductTerm buyProductTerm);

    CreditLevel findCreditLevelByCreditScore(@Param("creditScore") int creditScore);

    Integer findNextLevelDifferCreditScore(CreditLevel creditLevel);

    Integer addApplySeller(@Param("uid") int uid, @Param("shopName") String shopName);

    ApplySeller findUserApplySellerStatus(@Param("uid") int uid);

    Integer deleteApplySeller(@Param("uid") int uid);

    Integer updateShopPrimaryInfo(Shop shop);

    Integer updateShopHeadByShopId(@Param("shopId") int shopId, @Param("shopHead") String shopHead);

    Integer updateShopPrimaryImage(@Param("shopId") int shopId, @Param("shopImage") String shopImage);

    Integer updateShopCategoryBackgroundColor(@Param("shopId") int shopId, @Param("color") String color);

    Integer updateShopCategoryForegroundColor(@Param("shopId") int shopId, @Param("color") String color);

    Integer addShopSwitchImage(ShopSwitchImage shopSwitchImage);

    Integer deleteShopSwitchImage(ShopSwitchImage shopSwitchImage);

}
